const mongoose = require('mongoose');

const url = 'mongodb://localhost/test'

mongoose.connect(url,{ useNewUrlParser: true ,useUnifiedTopology: true })
  .then(() => console.log('连接成功!'))
  .catch(error => console.log('连接失败!' + error))
module.exports = mongoose 